• Governor tests

    Governor tests

    Accounts

    Seed Address Public_key Public_key_hash Secret_key
    'Alice'tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiedpkuvNy6TuQ2z8o9wnoaTtTXkzQk7nhegCHfxBc4ecsd4qG71KYNGtz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiedskRijgcXx8gzqkq7SCBbrb6aDZQMmP6dznCQWgU1Jr4qPfJT1yFq5A39ja9G4wahS8uWtBurZy14Hy7GZkQh7WnopJTKtCQG
    'admin'tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5edpkthtmpNV7DzPgvsU5ktVkfYbARpb2nzDbncU8mdbMeXGRhGTjN7tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5edskRjPeZkNsmeJ8aAzs5vyXVhP7DVRvG6nM1ReNfjzkR3h6ykbf71mPxQyE5HU9FHrV3EdrY4GVCSBWhU44v6bnhQGrKM9Cs8

    Contracts

    Contract

    New contract: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT10
    True

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(account_assets = sp.TBigMap(sp.TAddress, sp.TSet(sp.TAddress)), account_liquidity = sp.TBigMap(sp.TAddress, sp.TRecord(liquidity = sp.TInt, updateLevel = sp.TNat, valid = sp.TBool).layout(("liquidity", ("updateLevel", "valid")))), activeOperations = sp.TSet(sp.TNat), administrator = sp.TAddress, calculation = sp.TRecord(account = sp.TOption(sp.TAddress), borrowAmount = sp.TNat, cTokenModify = sp.TOption(sp.TAddress), redeemTokens = sp.TNat, sumBorrowPlusEffects = sp.TNat, sumCollateral = sp.TNat).layout((("account", ("borrowAmount", "cTokenModify")), ("redeemTokens", ("sumBorrowPlusEffects", "sumCollateral")))), closeFactorMantissa = sp.TNat, expScale = sp.TNat, halfExpScale = sp.TNat, liquidationIncentiveMantissa = sp.TNat, liquidityPeriodRelevance = sp.TNat, marketNameToAddress = sp.TMap(sp.TString, sp.TAddress), markets = sp.TMap(sp.TAddress, sp.TRecord(accountMembership = sp.TBigMap(sp.TAddress, sp.TBool), borrowCap = sp.TNat, borrowPaused = sp.TBool, collateralFactor = sp.TRecord(mantissa = sp.TNat).layout("mantissa"), isListed = sp.TBool, mintPaused = sp.TBool, name = sp.TString, price = sp.TRecord(mantissa = sp.TNat).layout("mantissa"), updateLevel = sp.TNat).layout(((("accountMembership", "borrowCap"), ("borrowPaused", "collateralFactor")), (("isListed", "mintPaused"), ("name", ("price", "updateLevel")))))), oracleAddress = sp.TAddress, pendingAdministrator = sp.TOption(sp.TAddress), pricePeriodRelevance = sp.TNat, transferPaused = sp.TBool).layout((((("account_assets", "account_liquidity"), ("activeOperations", "administrator")), (("calculation", "closeFactorMantissa"), ("expScale", "halfExpScale"))), ((("liquidationIncentiveMantissa", "liquidityPeriodRelevance"), ("marketNameToAddress", "markets")), (("oracleAddress", "pendingAdministrator"), ("pricePeriodRelevance", "transferPaused"))))))
      self.init(account_assets = {},
                account_liquidity = {},
                activeOperations = sp.set([]),
                administrator = sp.address('KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1'),
                calculation = sp.record(account = sp.none, borrowAmount = 0, cTokenModify = sp.none, redeemTokens = 0, sumBorrowPlusEffects = 0, sumCollateral = 0),
                closeFactorMantissa = 0,
                expScale = 1000000000000000000,
                halfExpScale = 500000000000000000,
                liquidationIncentiveMantissa = 0,
                liquidityPeriodRelevance = 5,
                marketNameToAddress = {},
                markets = {},
                oracleAddress = sp.address('KT10'),
                pendingAdministrator = sp.none,
                pricePeriodRelevance = 5,
                transferPaused = True)


    @sp.entry_point
    def acceptGovernance(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.pendingAdministrator.open_some(message = 'CMPT_NOT_SET_PENDING_ADMIN'), 'CMPT_NOT_PENDING_ADMIN')
      self.data.administrator = self.data.pendingAdministrator.open_some()
      self.data.pendingAdministrator = sp.none

    @sp.entry_point
    def borrowAllowed(self, params):
      sp.set_type(params, sp.TRecord(borrowAmount = sp.TNat, borrower = sp.TAddress, cToken = sp.TAddress).layout(("cToken", ("borrower", "borrowAmount"))))
      sp.verify(~ self.data.markets[params.cToken].borrowPaused, 'CMPT_BORROW_PAUSED')
      sp.verify((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed, 'CMPT_MARKET_NOT_LISTED')
      sp.if ~ ((self.data.markets[params.cToken].accountMembership.contains(params.borrower)) & self.data.markets[params.cToken].accountMembership[params.borrower]):
        sp.verify(sp.sender == params.cToken, 'CMPT_INVALID_BORROW_SENDER')
        sp.verify((self.data.markets.contains(sp.sender)) & self.data.markets[sp.sender].isListed, 'CMPT_MARKET_NOT_LISTED')
        sp.verify(~ ((self.data.markets[sp.sender].accountMembership.contains(params.borrower)) & self.data.markets[sp.sender].accountMembership[params.borrower]), 'CMPT_MARKET_JOINED')
        self.data.markets[sp.sender].accountMembership[params.borrower] = True
        sp.if self.data.account_assets.contains(params.borrower):
          self.data.account_assets[params.borrower].add(sp.sender)
        sp.else:
          self.data.account_assets[params.borrower] = sp.set([sp.sender])
      sp.verify(self.data.account_liquidity.contains(params.borrower), 'CMPT_LIQUIDITY_ABSENT')
      sp.verify(self.data.account_liquidity[params.borrower].valid, 'CMPT_LIQUIDITY_INVALID')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.account_liquidity[params.borrower].updateLevel, sp.TNat)
      compute_Comptroller_625 = sp.local("compute_Comptroller_625", sp.as_nat(sp.level - self.data.account_liquidity[params.borrower].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_Comptroller_625.value < self.data.liquidityPeriodRelevance, 'CMPT_LIQUIDITY_OLD')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.markets[params.cToken].updateLevel, sp.TNat)
      compute_Comptroller_270 = sp.local("compute_Comptroller_270", sp.as_nat(sp.level - self.data.markets[params.cToken].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_Comptroller_270.value < self.data.pricePeriodRelevance, 'CMPT_UPDATE_PRICE')
      sp.verify(self.data.markets[params.cToken].price.mantissa > 0, 'CMPT_INVALID_PRICE')
      sp.set_type(self.data.markets[params.cToken].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.markets[params.cToken].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(params.borrowAmount, sp.TNat)
      sp.set_type(self.data.markets[params.cToken].price.mantissa * params.borrowAmount, sp.TNat)
      sp.set_type(sp.record(mantissa = self.data.markets[params.cToken].price.mantissa * params.borrowAmount), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      compute_Comptroller_174 = sp.local("compute_Comptroller_174", self.data.account_liquidity[params.borrower].liquidity - sp.to_int((self.data.markets[params.cToken].price.mantissa * params.borrowAmount) // self.data.expScale))
      sp.verify(compute_Comptroller_174.value >= 0, 'CMPT_REDEEMER_SHORTFALL')
      sp.if self.data.account_liquidity.contains(params.borrower):
        self.data.account_liquidity[params.borrower].valid = False

    @sp.entry_point
    def calculateAccountAssetLiquidity(self, params):
      sp.set_type(params, sp.TRecord(account = sp.TAddress, borrowBalance = sp.TNat, cTokenBalance = sp.TNat, exchangeRateMantissa = sp.TNat).layout((("account", "borrowBalance"), ("cTokenBalance", "exchangeRateMantissa"))))
      sp.verify(self.data.activeOperations.contains(3), 'OP_NOT_ACTIVE')
      sp.set_type(params.exchangeRateMantissa, sp.TNat)
      compute_Comptroller_376 = sp.local("compute_Comptroller_376", sp.record(mantissa = params.exchangeRateMantissa))
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.markets[sp.sender].updateLevel, sp.TNat)
      compute_Comptroller_270 = sp.local("compute_Comptroller_270", sp.as_nat(sp.level - self.data.markets[sp.sender].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_Comptroller_270.value < self.data.pricePeriodRelevance, 'CMPT_UPDATE_PRICE')
      sp.verify(self.data.markets[sp.sender].price.mantissa > 0, 'CMPT_INVALID_PRICE')
      sp.set_type(self.data.markets[sp.sender].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.markets[sp.sender].collateralFactor, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type((self.data.markets[sp.sender].price.mantissa * self.data.markets[sp.sender].collateralFactor.mantissa) // self.data.expScale, sp.TNat)
      sp.set_type(sp.record(mantissa = (self.data.markets[sp.sender].price.mantissa * self.data.markets[sp.sender].collateralFactor.mantissa) // self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_Comptroller_376.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type((((self.data.markets[sp.sender].price.mantissa * self.data.markets[sp.sender].collateralFactor.mantissa) // self.data.expScale) * compute_Comptroller_376.value.mantissa) // self.data.expScale, sp.TNat)
      compute_Comptroller_379 = sp.local("compute_Comptroller_379", sp.record(mantissa = (((self.data.markets[sp.sender].price.mantissa * self.data.markets[sp.sender].collateralFactor.mantissa) // self.data.expScale) * compute_Comptroller_376.value.mantissa) // self.data.expScale))
      sp.set_type(compute_Comptroller_379.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_Comptroller_379.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(params.cTokenBalance, sp.TNat)
      sp.set_type(compute_Comptroller_379.value.mantissa * params.cTokenBalance, sp.TNat)
      sp.set_type(sp.record(mantissa = compute_Comptroller_379.value.mantissa * params.cTokenBalance), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      self.data.calculation.sumCollateral += (compute_Comptroller_379.value.mantissa * params.cTokenBalance) // self.data.expScale
      sp.set_type(self.data.markets[sp.sender].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.markets[sp.sender].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(params.borrowBalance, sp.TNat)
      sp.set_type(self.data.markets[sp.sender].price.mantissa * params.borrowBalance, sp.TNat)
      sp.set_type(sp.record(mantissa = self.data.markets[sp.sender].price.mantissa * params.borrowBalance), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      self.data.calculation.sumBorrowPlusEffects += (self.data.markets[sp.sender].price.mantissa * params.borrowBalance) // self.data.expScale
      sp.if sp.some(sp.sender) == self.data.calculation.cTokenModify:
        sp.set_type(compute_Comptroller_379.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(compute_Comptroller_379.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.calculation.redeemTokens, sp.TNat)
        sp.set_type(compute_Comptroller_379.value.mantissa * self.data.calculation.redeemTokens, sp.TNat)
        sp.set_type(sp.record(mantissa = compute_Comptroller_379.value.mantissa * self.data.calculation.redeemTokens), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        self.data.calculation.sumCollateral += (compute_Comptroller_379.value.mantissa * self.data.calculation.redeemTokens) // self.data.expScale
        sp.set_type(self.data.markets[sp.sender].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.markets[sp.sender].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.calculation.borrowAmount, sp.TNat)
        sp.set_type(self.data.markets[sp.sender].price.mantissa * self.data.calculation.borrowAmount, sp.TNat)
        sp.set_type(sp.record(mantissa = self.data.markets[sp.sender].price.mantissa * self.data.calculation.borrowAmount), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        self.data.calculation.sumBorrowPlusEffects += (self.data.markets[sp.sender].price.mantissa * self.data.calculation.borrowAmount) // self.data.expScale

    @sp.entry_point
    def disableMarket(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      sp.verify((self.data.markets.contains(params)) & self.data.markets[params].isListed, 'CMPT_MARKET_NOT_LISTED')
      self.data.markets[params].isListed = False

    @sp.entry_point
    def enterMarkets(self, params):
      sp.set_type(params, sp.TList(sp.TAddress))
      sp.for token in params:
        sp.verify((self.data.markets.contains(token)) & self.data.markets[token].isListed, 'CMPT_MARKET_NOT_LISTED')
        sp.verify(~ ((self.data.markets[token].accountMembership.contains(sp.sender)) & self.data.markets[token].accountMembership[sp.sender]), 'CMPT_MARKET_JOINED')
        self.data.markets[token].accountMembership[sp.sender] = True
        sp.if self.data.account_assets.contains(sp.sender):
          self.data.account_assets[sp.sender].add(token)
        sp.else:
          self.data.account_assets[sp.sender] = sp.set([token])
      sp.if self.data.account_liquidity.contains(sp.sender):
        self.data.account_liquidity[sp.sender].valid = False

    @sp.entry_point
    def exitMarket(self, params):
      sp.set_type(params, sp.TAddress)
      self.data.activeOperations.add(1)
      sp.transfer((sp.sender, sp.self_entry_point('setAccountSnapAndExitMarket')), sp.tez(0), sp.contract(sp.TPair(sp.TAddress, sp.TContract(sp.TRecord(account = sp.TAddress, borrowBalance = sp.TNat, cTokenBalance = sp.TNat, exchangeRateMantissa = sp.TNat).layout((("account", "borrowBalance"), ("cTokenBalance", "exchangeRateMantissa"))))), params, entry_point='getAccountSnapshot').open_some())

    @sp.entry_point
    def getHypoAccountLiquidity(self, params):
      sp.set_type(params, sp.TRecord(callback = sp.TContract(sp.TInt), data = sp.TRecord(account = sp.TAddress, borrowAmount = sp.TNat, cTokenModify = sp.TAddress, redeemTokens = sp.TNat).layout(("account", ("cTokenModify", ("redeemTokens", "borrowAmount"))))).layout(("callback", "data")))
      self.data.activeOperations.add(3)
      self.data.calculation = sp.record(account = sp.some(params.data.account), borrowAmount = params.data.borrowAmount, cTokenModify = sp.some(params.data.cTokenModify), redeemTokens = params.data.redeemTokens, sumBorrowPlusEffects = 0, sumCollateral = 0)
      sp.if self.data.account_assets.contains(params.data.account):
        sp.for asset in self.data.account_assets[params.data.account].elements():
          sp.transfer((params.data.account, sp.self_entry_point('calculateAccountAssetLiquidity')), sp.tez(0), sp.contract(sp.TPair(sp.TAddress, sp.TContract(sp.TRecord(account = sp.TAddress, borrowBalance = sp.TNat, cTokenBalance = sp.TNat, exchangeRateMantissa = sp.TNat).layout((("account", "borrowBalance"), ("cTokenBalance", "exchangeRateMantissa"))))), asset, entry_point='getAccountSnapshot').open_some())
      sp.transfer((sp.unit, params.callback), sp.tez(0), sp.self_entry_point('returnHypoAccountLiquidity'))

    @sp.entry_point
    def hardResetOp(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      self.data.activeOperations = sp.set([])

    @sp.entry_point
    def mintAllowed(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, mintAmount = sp.TNat, minter = sp.TAddress).layout(("cToken", ("minter", "mintAmount"))))
      sp.verify(~ self.data.markets[params.cToken].mintPaused, 'CMPT_MINT_PAUSED')
      sp.verify((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed, 'CMPT_MARKET_NOT_LISTED')
      sp.if self.data.account_liquidity.contains(params.minter):
        self.data.account_liquidity[params.minter].valid = False

    @sp.entry_point
    def redeemAllowed(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, redeemAmount = sp.TNat, redeemer = sp.TAddress).layout(("cToken", ("redeemer", "redeemAmount"))))
      sp.verify((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed, 'CMPT_MARKET_NOT_LISTED')
      sp.if (self.data.markets[params.cToken].accountMembership.contains(params.redeemer)) & self.data.markets[params.cToken].accountMembership[params.redeemer]:
        sp.verify(self.data.account_liquidity.contains(params.redeemer), 'CMPT_LIQUIDITY_ABSENT')
        sp.verify(self.data.account_liquidity[params.redeemer].valid, 'CMPT_LIQUIDITY_INVALID')
        sp.set_type(sp.level, sp.TNat)
        sp.set_type(self.data.account_liquidity[params.redeemer].updateLevel, sp.TNat)
        compute_Comptroller_625 = sp.local("compute_Comptroller_625", sp.as_nat(sp.level - self.data.account_liquidity[params.redeemer].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
        sp.verify(compute_Comptroller_625.value < self.data.liquidityPeriodRelevance, 'CMPT_LIQUIDITY_OLD')
        sp.set_type(sp.level, sp.TNat)
        sp.set_type(self.data.markets[params.cToken].updateLevel, sp.TNat)
        compute_Comptroller_270 = sp.local("compute_Comptroller_270", sp.as_nat(sp.level - self.data.markets[params.cToken].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
        sp.verify(compute_Comptroller_270.value < self.data.pricePeriodRelevance, 'CMPT_UPDATE_PRICE')
        sp.verify(self.data.markets[params.cToken].price.mantissa > 0, 'CMPT_INVALID_PRICE')
        sp.set_type(self.data.markets[params.cToken].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.markets[params.cToken].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(params.redeemAmount, sp.TNat)
        sp.set_type(self.data.markets[params.cToken].price.mantissa * params.redeemAmount, sp.TNat)
        sp.set_type(sp.record(mantissa = self.data.markets[params.cToken].price.mantissa * params.redeemAmount), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        compute_Comptroller_174 = sp.local("compute_Comptroller_174", self.data.account_liquidity[params.redeemer].liquidity - sp.to_int((self.data.markets[params.cToken].price.mantissa * params.redeemAmount) // self.data.expScale))
        sp.verify(compute_Comptroller_174.value >= 0, 'CMPT_REDEEMER_SHORTFALL')
      sp.if self.data.account_liquidity.contains(params.redeemer):
        self.data.account_liquidity[params.redeemer].valid = False

    @sp.entry_point
    def repayBorrowAllowed(self, params):
      sp.set_type(params, sp.TRecord(borrower = sp.TAddress, cToken = sp.TAddress, payer = sp.TAddress, repayAmount = sp.TNat).layout(("cToken", ("payer", ("borrower", "repayAmount")))))
      sp.verify((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed, 'CMPT_MARKET_NOT_LISTED')
      sp.if self.data.account_liquidity.contains(params.borrower):
        self.data.account_liquidity[params.borrower].valid = False
      sp.if self.data.account_liquidity.contains(params.payer):
        self.data.account_liquidity[params.payer].valid = False

    @sp.entry_point
    def returnHypoAccountLiquidity(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      sp.verify(self.data.activeOperations.contains(3), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(3)
      compute_Comptroller_331 = sp.local("compute_Comptroller_331", self.data.calculation.sumCollateral - self.data.calculation.sumBorrowPlusEffects)
      self.data.calculation = sp.record(account = sp.none, borrowAmount = 0, cTokenModify = sp.none, redeemTokens = 0, sumBorrowPlusEffects = 0, sumCollateral = 0)
      __s1 = sp.local("__s1", compute_Comptroller_331.value)
      sp.set_type(sp.snd(params), sp.TContract(sp.TInt))
      sp.transfer(__s1.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def setAccountLiquidity(self, params):
      sp.set_type(params, sp.TUnit)
      self.data.account_liquidity[self.data.calculation.account.open_some()] = sp.record(liquidity = self.data.calculation.sumCollateral - self.data.calculation.sumBorrowPlusEffects, updateLevel = sp.level, valid = True)
      self.data.calculation = sp.record(account = sp.none, borrowAmount = 0, cTokenModify = sp.none, redeemTokens = 0, sumBorrowPlusEffects = 0, sumCollateral = 0)

    @sp.entry_point
    def setAccountSnapAndExitMarket(self, params):
      sp.set_type(params, sp.TRecord(account = sp.TAddress, borrowBalance = sp.TNat, cTokenBalance = sp.TNat, exchangeRateMantissa = sp.TNat).layout((("account", "borrowBalance"), ("cTokenBalance", "exchangeRateMantissa"))))
      sp.verify(params.borrowBalance == 0, 'CMPT_BORROW_IN_MARKET')
      sp.verify((self.data.markets.contains(sp.sender)) & self.data.markets[sp.sender].isListed, 'CMPT_MARKET_NOT_LISTED')
      sp.if (self.data.markets[sp.sender].accountMembership.contains(params.account)) & self.data.markets[sp.sender].accountMembership[params.account]:
        sp.verify(self.data.account_liquidity.contains(params.account), 'CMPT_LIQUIDITY_ABSENT')
        sp.verify(self.data.account_liquidity[params.account].valid, 'CMPT_LIQUIDITY_INVALID')
        sp.set_type(sp.level, sp.TNat)
        sp.set_type(self.data.account_liquidity[params.account].updateLevel, sp.TNat)
        compute_Comptroller_625 = sp.local("compute_Comptroller_625", sp.as_nat(sp.level - self.data.account_liquidity[params.account].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
        sp.verify(compute_Comptroller_625.value < self.data.liquidityPeriodRelevance, 'CMPT_LIQUIDITY_OLD')
        sp.set_type(sp.level, sp.TNat)
        sp.set_type(self.data.markets[sp.sender].updateLevel, sp.TNat)
        compute_Comptroller_270 = sp.local("compute_Comptroller_270", sp.as_nat(sp.level - self.data.markets[sp.sender].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
        sp.verify(compute_Comptroller_270.value < self.data.pricePeriodRelevance, 'CMPT_UPDATE_PRICE')
        sp.verify(self.data.markets[sp.sender].price.mantissa > 0, 'CMPT_INVALID_PRICE')
        sp.set_type(self.data.markets[sp.sender].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.markets[sp.sender].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(params.cTokenBalance, sp.TNat)
        sp.set_type(self.data.markets[sp.sender].price.mantissa * params.cTokenBalance, sp.TNat)
        sp.set_type(sp.record(mantissa = self.data.markets[sp.sender].price.mantissa * params.cTokenBalance), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        compute_Comptroller_174 = sp.local("compute_Comptroller_174", self.data.account_liquidity[params.account].liquidity - sp.to_int((self.data.markets[sp.sender].price.mantissa * params.cTokenBalance) // self.data.expScale))
        sp.verify(compute_Comptroller_174.value >= 0, 'CMPT_REDEEMER_SHORTFALL')
      sp.if self.data.account_liquidity.contains(params.account):
        self.data.account_liquidity[params.account].valid = False
      sp.if (self.data.markets[sp.sender].accountMembership.contains(params.account)) & self.data.markets[sp.sender].accountMembership[params.account]:
        del self.data.markets[sp.sender].accountMembership[params.account]
        self.data.account_assets[params.account].remove(sp.sender)
      sp.if self.data.account_liquidity.contains(params.account):
        self.data.account_liquidity[params.account].valid = False

    @sp.entry_point
    def setAssetPrice(self, params):
      sp.set_type(params, sp.TPair(sp.TString, sp.TPair(sp.TTimestamp, sp.TNat)))
      sp.verify(self.data.activeOperations.contains(2), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(2)
      compute_Comptroller_263 = sp.local("compute_Comptroller_263", sp.fst(params))
      compute_Comptroller_264 = sp.local("compute_Comptroller_264", sp.snd(params))
      sp.set_type(sp.snd(compute_Comptroller_264.value), sp.TNat)
      sp.set_type(sp.snd(compute_Comptroller_264.value) * self.data.expScale, sp.TNat)
      self.data.markets[self.data.marketNameToAddress[compute_Comptroller_263.value]].price = sp.record(mantissa = sp.snd(compute_Comptroller_264.value) * self.data.expScale)
      self.data.markets[self.data.marketNameToAddress[compute_Comptroller_263.value]].updateLevel = sp.level

    @sp.entry_point
    def setBorrowPaused(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, state = sp.TBool).layout(("cToken", "state")))
      sp.verify((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed, 'CMPT_MARKET_NOT_LISTED')
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      self.data.markets[params.cToken].borrowPaused = params.state

    @sp.entry_point
    def setCloseFactor(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      self.data.closeFactorMantissa = params

    @sp.entry_point
    def setCollateralFactor(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, newCollateralFactor = sp.TNat).layout(("cToken", "newCollateralFactor")))
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      sp.verify((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed, 'CMPT_MARKET_NOT_LISTED')
      self.data.markets[params.cToken].collateralFactor.mantissa = params.newCollateralFactor

    @sp.entry_point
    def setLiquidationIncentive(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      self.data.liquidationIncentiveMantissa = params

    @sp.entry_point
    def setLiquidityPeriodRelevance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      sp.set_type(params, sp.TNat)
      self.data.liquidityPeriodRelevance = params

    @sp.entry_point
    def setMarketBorrowCap(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, newBorrowCap = sp.TNat).layout(("cToken", "newBorrowCap")))
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      sp.verify(self.data.markets.contains(params.cToken), 'CMPT_MARKET_NOT_EXISTS')
      self.data.markets[params.cToken].borrowCap = params.newBorrowCap

    @sp.entry_point
    def setMintPaused(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, state = sp.TBool).layout(("cToken", "state")))
      sp.verify((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed, 'CMPT_MARKET_NOT_LISTED')
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      self.data.markets[params.cToken].mintPaused = params.state

    @sp.entry_point
    def setPendingGovernance(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      self.data.pendingAdministrator = sp.some(params)

    @sp.entry_point
    def setPriceOracle(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      self.data.oracleAddress = params

    @sp.entry_point
    def setPricePeriodRelevance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      sp.set_type(params, sp.TNat)
      self.data.pricePeriodRelevance = params

    @sp.entry_point
    def setTransferPaused(self, params):
      sp.set_type(params, sp.TBool)
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      self.data.transferPaused = params

    @sp.entry_point
    def supportMarket(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, name = sp.TString).layout(("cToken", "name")))
      sp.verify(sp.sender == self.data.administrator, 'CMPT_NOT_ADMIN')
      sp.verify(~ ((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed), 'CMPT_MARKET_ALREADY_LISTED')
      sp.set_type(900000000000000000, sp.TNat)
      sp.set_type(0, sp.TNat)
      self.data.markets[params.cToken] = sp.record(accountMembership = sp.set_type_expr({}, sp.TBigMap(sp.TAddress, sp.TBool)), borrowCap = 0, borrowPaused = True, collateralFactor = sp.record(mantissa = 900000000000000000), isListed = True, mintPaused = True, name = params.name, price = sp.record(mantissa = 0), updateLevel = 0)
      self.data.marketNameToAddress[params.name] = params.cToken

    @sp.entry_point
    def sweepFA12(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", "tokenAddress")))
      sp.transfer(sp.record(from_ = sp.self_address, to_ = self.data.administrator, value = params.amount), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepFA2(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, id = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", ("id", "tokenAddress"))))
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = self.data.administrator, token_id = params.id, amount = params.amount)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepMutez(self, params):
      sp.set_type(params, sp.TBool)
      sp.if params:
        sp.send(self.data.administrator, sp.balance)
      sp.else:
        sp.send(self.data.administrator, sp.balance)

    @sp.entry_point
    def transferAllowed(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, dst = sp.TAddress, src = sp.TAddress, transferTokens = sp.TNat).layout((("cToken", "src"), ("dst", "transferTokens"))))
      sp.verify(~ self.data.transferPaused, 'CMPT_TRANSFER_PAUSED')
      sp.verify((self.data.markets.contains(params.cToken)) & self.data.markets[params.cToken].isListed, 'CMPT_MARKET_NOT_LISTED')
      sp.if (self.data.markets[params.cToken].accountMembership.contains(params.src)) & self.data.markets[params.cToken].accountMembership[params.src]:
        sp.verify(self.data.account_liquidity.contains(params.src), 'CMPT_LIQUIDITY_ABSENT')
        sp.verify(self.data.account_liquidity[params.src].valid, 'CMPT_LIQUIDITY_INVALID')
        sp.set_type(sp.level, sp.TNat)
        sp.set_type(self.data.account_liquidity[params.src].updateLevel, sp.TNat)
        compute_Comptroller_625 = sp.local("compute_Comptroller_625", sp.as_nat(sp.level - self.data.account_liquidity[params.src].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
        sp.verify(compute_Comptroller_625.value < self.data.liquidityPeriodRelevance, 'CMPT_LIQUIDITY_OLD')
        sp.set_type(sp.level, sp.TNat)
        sp.set_type(self.data.markets[params.cToken].updateLevel, sp.TNat)
        compute_Comptroller_270 = sp.local("compute_Comptroller_270", sp.as_nat(sp.level - self.data.markets[params.cToken].updateLevel, message = 'SUBTRACTION_UNDERFLOW'))
        sp.verify(compute_Comptroller_270.value < self.data.pricePeriodRelevance, 'CMPT_UPDATE_PRICE')
        sp.verify(self.data.markets[params.cToken].price.mantissa > 0, 'CMPT_INVALID_PRICE')
        sp.set_type(self.data.markets[params.cToken].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.markets[params.cToken].price, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(params.transferTokens, sp.TNat)
        sp.set_type(self.data.markets[params.cToken].price.mantissa * params.transferTokens, sp.TNat)
        sp.set_type(sp.record(mantissa = self.data.markets[params.cToken].price.mantissa * params.transferTokens), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        compute_Comptroller_174 = sp.local("compute_Comptroller_174", self.data.account_liquidity[params.src].liquidity - sp.to_int((self.data.markets[params.cToken].price.mantissa * params.transferTokens) // self.data.expScale))
        sp.verify(compute_Comptroller_174.value >= 0, 'CMPT_REDEEMER_SHORTFALL')
      sp.if self.data.account_liquidity.contains(params.src):
        self.data.account_liquidity[params.src].valid = False

    @sp.entry_point
    def updateAccountLiquidity(self, params):
      sp.set_type(params, sp.TAddress)
      self.data.activeOperations.add(3)
      self.data.calculation = sp.record(account = sp.some(params), borrowAmount = 0, cTokenModify = sp.none, redeemTokens = 0, sumBorrowPlusEffects = 0, sumCollateral = 0)
      sp.if self.data.account_assets.contains(params):
        sp.for asset in self.data.account_assets[params].elements():
          sp.transfer((params, sp.self_entry_point('calculateAccountAssetLiquidity')), sp.tez(0), sp.contract(sp.TPair(sp.TAddress, sp.TContract(sp.TRecord(account = sp.TAddress, borrowBalance = sp.TNat, cTokenBalance = sp.TNat, exchangeRateMantissa = sp.TNat).layout((("account", "borrowBalance"), ("cTokenBalance", "exchangeRateMantissa"))))), asset, entry_point='getAccountSnapshot').open_some())
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('setAccountLiquidity'))

    @sp.entry_point
    def updateAssetPrice(self, params):
      sp.set_type(params, sp.TAddress)
      sp.if self.data.markets[params].updateLevel < sp.level:
        self.data.activeOperations.add(2)
        sp.transfer((self.data.markets[params].name, sp.self_entry_point('setAssetPrice')), sp.tez(0), sp.contract(sp.TPair(sp.TString, sp.TContract(sp.TPair(sp.TString, sp.TPair(sp.TTimestamp, sp.TNat)))), self.data.oracleAddress, entry_point='get').open_some())
    Contract

    New contract: KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(administrator = sp.TAddress, pendingAdministrator = sp.TOption(sp.TAddress)).layout(("administrator", "pendingAdministrator")))
      self.init(administrator = sp.address('tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5'),
                pendingAdministrator = sp.none)


    @sp.entry_point
    def acceptContractGovernance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TAddress)
      sp.send(params, sp.tez(0))

    @sp.entry_point
    def acceptGovernance(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.pendingAdministrator.open_some(message = 'GOV_NOT_SET_PENDING_ADMIN'), 'GOV_NOT_PENDING_ADMIN')
      self.data.administrator = self.data.pendingAdministrator.open_some()
      self.data.pendingAdministrator = sp.none

    @sp.entry_point
    def disableMarket(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, comptroller = sp.TAddress).layout(("cToken", "comptroller")))
      sp.transfer(params.cToken, sp.tez(0), sp.contract(sp.TAddress, params.comptroller, entry_point='disableMarket').open_some())

    @sp.entry_point
    def receive(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def reduceReserves(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(amount = sp.TNat, cToken = sp.TAddress).layout(("amount", "cToken")))
      sp.transfer(params.amount, sp.tez(0), sp.contract(sp.TNat, params.cToken, entry_point='reduceReserves').open_some())

    @sp.entry_point
    def setAccrualIntPeriodRelevance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(blockNumber = sp.TNat, cToken = sp.TAddress).layout(("blockNumber", "cToken")))
      sp.transfer(params.blockNumber, sp.tez(0), sp.contract(sp.TNat, params.cToken, entry_point='setAccrualIntPeriodRelevance').open_some())

    @sp.entry_point
    def setBorrowPaused(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(comptroller = sp.TAddress, tokenState = sp.TRecord(cToken = sp.TAddress, state = sp.TBool).layout(("cToken", "state"))).layout(("comptroller", "tokenState")))
      sp.transfer(params.tokenState, sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, state = sp.TBool).layout(("cToken", "state")), params.comptroller, entry_point='setBorrowPaused').open_some())

    @sp.entry_point
    def setCloseFactor(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(closeFactor = sp.TNat, comptroller = sp.TAddress).layout(("closeFactor", "comptroller")))
      sp.transfer(params.closeFactor, sp.tez(0), sp.contract(sp.TNat, params.comptroller, entry_point='setCloseFactor').open_some())

    @sp.entry_point
    def setCollateralFactor(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(collateralFactor = sp.TRecord(cToken = sp.TAddress, newCollateralFactor = sp.TNat).layout(("cToken", "newCollateralFactor")), comptroller = sp.TAddress).layout(("collateralFactor", "comptroller")))
      sp.transfer(params.collateralFactor, sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, newCollateralFactor = sp.TNat).layout(("cToken", "newCollateralFactor")), params.comptroller, entry_point='setCollateralFactor').open_some())

    @sp.entry_point
    def setComptroller(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, comptroller = sp.TAddress).layout(("cToken", "comptroller")))
      sp.transfer(params.comptroller, sp.tez(0), sp.contract(sp.TAddress, params.cToken, entry_point='setComptroller').open_some())

    @sp.entry_point
    def setContractGovernance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(contractAddress = sp.TAddress, governance = sp.TAddress).layout(("contractAddress", "governance")))
      sp.transfer(params.governance, sp.tez(0), sp.contract(sp.TAddress, params.contractAddress, entry_point='setPendingGovernance').open_some())

    @sp.entry_point
    def setInterestRateModel(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, interestRateModel = sp.TAddress).layout(("cToken", "interestRateModel")))
      sp.transfer(params.interestRateModel, sp.tez(0), sp.contract(sp.TAddress, params.cToken, entry_point='setInterestRateModel').open_some())

    @sp.entry_point
    def setLiquidationIncentive(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(comptroller = sp.TAddress, liquidationIncentive = sp.TNat).layout(("comptroller", "liquidationIncentive")))
      sp.transfer(params.liquidationIncentive, sp.tez(0), sp.contract(sp.TNat, params.comptroller, entry_point='setLiquidationIncentive').open_some())

    @sp.entry_point
    def setLiquidityPeriodRelevance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(blockNumber = sp.TNat, comptroller = sp.TAddress).layout(("blockNumber", "comptroller")))
      sp.transfer(params.blockNumber, sp.tez(0), sp.contract(sp.TNat, params.comptroller, entry_point='setLiquidityPeriodRelevance').open_some())

    @sp.entry_point
    def setMarketBorrowCap(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(borrowCap = sp.TRecord(cToken = sp.TAddress, newBorrowCap = sp.TNat).layout(("cToken", "newBorrowCap")), comptroller = sp.TAddress).layout(("borrowCap", "comptroller")))
      sp.transfer(params.borrowCap, sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, newBorrowCap = sp.TNat).layout(("cToken", "newBorrowCap")), params.comptroller, entry_point='setMarketBorrowCap').open_some())

    @sp.entry_point
    def setMintPaused(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(comptroller = sp.TAddress, tokenState = sp.TRecord(cToken = sp.TAddress, state = sp.TBool).layout(("cToken", "state"))).layout(("comptroller", "tokenState")))
      sp.transfer(params.tokenState, sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, state = sp.TBool).layout(("cToken", "state")), params.comptroller, entry_point='setMintPaused').open_some())

    @sp.entry_point
    def setPendingGovernance(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      self.data.pendingAdministrator = sp.some(params)

    @sp.entry_point
    def setPriceOracle(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(comptroller = sp.TAddress, priceOracle = sp.TAddress).layout(("comptroller", "priceOracle")))
      sp.transfer(params.priceOracle, sp.tez(0), sp.contract(sp.TAddress, params.comptroller, entry_point='setPriceOracle').open_some())

    @sp.entry_point
    def setPricePeriodRelevance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(blockNumber = sp.TNat, comptroller = sp.TAddress).layout(("blockNumber", "comptroller")))
      sp.transfer(params.blockNumber, sp.tez(0), sp.contract(sp.TNat, params.comptroller, entry_point='setPricePeriodRelevance').open_some())

    @sp.entry_point
    def setReserveFactor(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, newReserveFactor = sp.TNat).layout(("cToken", "newReserveFactor")))
      sp.transfer(params.newReserveFactor, sp.tez(0), sp.contract(sp.TNat, params.cToken, entry_point='setReserveFactor').open_some())

    @sp.entry_point
    def setTransferPaused(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(comptroller = sp.TAddress, state = sp.TBool).layout(("comptroller", "state")))
      sp.transfer(params.state, sp.tez(0), sp.contract(sp.TBool, params.comptroller, entry_point='setTransferPaused').open_some())

    @sp.entry_point
    def supportMarket(self, params):
      sp.verify(sp.sender == self.data.administrator, 'GOV_NOT_ADMIN')
      sp.set_type(params, sp.TRecord(comptroller = sp.TAddress, market = sp.TRecord(cToken = sp.TAddress, name = sp.TString).layout(("cToken", "name"))).layout(("comptroller", "market")))
      sp.transfer(params.market, sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, name = sp.TString).layout(("cToken", "name")), params.comptroller, entry_point='supportMarket').open_some())

    @sp.entry_point
    def sweepFA12(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", "tokenAddress")))
      sp.transfer(sp.record(from_ = sp.self_address, to_ = self.data.administrator, value = params.amount), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepFA2(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, id = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", ("id", "tokenAddress"))))
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = self.data.administrator, token_id = params.id, amount = params.amount)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepMutez(self, params):
      sp.set_type(params, sp.TBool)
      sp.if params:
        sp.send(self.data.administrator, sp.balance)
      sp.else:
        sp.send(self.data.administrator, sp.balance)
    Contract

    New contract: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Storage:

    BaseRatePerBlock MultiplierPerBlock Scale

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(baseRatePerBlock = sp.TNat, multiplierPerBlock = sp.TNat, scale = sp.TNat).layout(("baseRatePerBlock", ("multiplierPerBlock", "scale"))))
      self.init(baseRatePerBlock = 840000000000,
                multiplierPerBlock = 180000000000,
                scale = 1000000000000000000)


    @sp.entry_point
    def getBorrowRate(self, params):
      sp.set_type(params, sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))))
      ur = sp.local("ur", 0)
      sp.if params.borrows > 0:
        compute_InterestRateModel_55 = sp.local("compute_InterestRateModel_55", sp.as_nat((params.cash + params.borrows) - params.reserves))
        sp.verify(compute_InterestRateModel_55.value > 0, 'IRM_INSUFFICIENT_CASH')
        ur.value = (params.borrows * self.data.scale) // compute_InterestRateModel_55.value
      compute_InterestRateModel_62 = sp.local("compute_InterestRateModel_62", ((ur.value * self.data.multiplierPerBlock) // self.data.scale) + self.data.baseRatePerBlock)
      sp.transfer(compute_InterestRateModel_62.value, sp.tez(0), params.cb)

    @sp.entry_point
    def getSupplyRate(self, params):
      sp.set_type(params, sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserveFactorMantissa = sp.TNat, reserves = sp.TNat).layout((("borrows", "cash"), ("cb", ("reserveFactorMantissa", "reserves")))))
      ur = sp.local("ur", 0)
      sp.if params.borrows > 0:
        compute_InterestRateModel_55 = sp.local("compute_InterestRateModel_55", sp.as_nat((params.cash + params.borrows) - params.reserves))
        sp.verify(compute_InterestRateModel_55.value > 0, 'IRM_INSUFFICIENT_CASH')
        ur.value = (params.borrows * self.data.scale) // compute_InterestRateModel_55.value
      compute_InterestRateModel_62 = sp.local("compute_InterestRateModel_62", ((ur.value * self.data.multiplierPerBlock) // self.data.scale) + self.data.baseRatePerBlock)
      sp.transfer((ur.value * ((compute_InterestRateModel_62.value * sp.as_nat(self.data.scale - params.reserveFactorMantissa)) // self.data.scale)) // self.data.scale, sp.tez(0), params.cb)
    Contract

    New contract: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(accrualBlockNumber = sp.TNat, accrualIntPeriodRelevance = sp.TNat, activeOperations = sp.TSet(sp.TNat), administrator = sp.TAddress, balances = sp.TBigMap(sp.TAddress, sp.TRecord(accountBorrows = sp.TRecord(interestIndex = sp.TNat, principal = sp.TNat).layout(("interestIndex", "principal")), approvals = sp.TMap(sp.TAddress, sp.TNat), balance = sp.TNat).layout(("accountBorrows", ("approvals", "balance")))), borrowIndex = sp.TNat, borrowRateMaxMantissa = sp.TNat, borrowRatePerBlock = sp.TNat, comptroller = sp.TAddress, expScale = sp.TNat, halfExpScale = sp.TNat, initialExchangeRateMantissa = sp.TNat, interestRateModel = sp.TAddress, isAccrualInterestValid = sp.TBool, pendingAdministrator = sp.TOption(sp.TAddress), reserveFactorMantissa = sp.TNat, reserveFactorMaxMantissa = sp.TNat, supplyRatePerBlock = sp.TNat, totalBorrows = sp.TNat, totalReserves = sp.TNat, totalSupply = sp.TNat).layout((((("accrualBlockNumber", "accrualIntPeriodRelevance"), ("activeOperations", ("administrator", "balances"))), (("borrowIndex", "borrowRateMaxMantissa"), ("borrowRatePerBlock", ("comptroller", "expScale")))), ((("halfExpScale", "initialExchangeRateMantissa"), ("interestRateModel", ("isAccrualInterestValid", "pendingAdministrator"))), (("reserveFactorMantissa", ("reserveFactorMaxMantissa", "supplyRatePerBlock")), ("totalBorrows", ("totalReserves", "totalSupply")))))))
      self.init(accrualBlockNumber = 0,
                accrualIntPeriodRelevance = 5,
                activeOperations = sp.set([]),
                administrator = sp.address('KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1'),
                balances = {},
                borrowIndex = 1000000000000000000,
                borrowRateMaxMantissa = 5000000000000,
                borrowRatePerBlock = 0,
                comptroller = sp.address('KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF'),
                expScale = 1000000000000000000,
                halfExpScale = 500000000000000000,
                initialExchangeRateMantissa = 1000000000000000000,
                interestRateModel = sp.address('KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H'),
                isAccrualInterestValid = False,
                pendingAdministrator = sp.none,
                reserveFactorMantissa = 0,
                reserveFactorMaxMantissa = 1000000000000000000,
                supplyRatePerBlock = 0,
                totalBorrows = 0,
                totalReserves = 0,
                totalSupply = 0)


    @sp.entry_point
    def acceptGovernance(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.pendingAdministrator.open_some(message = 'CT_NOT_SET_PENDING_ADMIN'), 'CT_NOT_PENDING_ADMIN')
      self.data.administrator = self.data.pendingAdministrator.open_some()
      self.data.pendingAdministrator = sp.none

    @sp.entry_point
    def accrueInterest(self, params):
      sp.set_type(params, sp.TUnit)
      sp.if self.data.accrualBlockNumber == 0:
        self.data.accrualBlockNumber = sp.level
      sp.if sp.level != self.data.accrualBlockNumber:
        self.data.activeOperations.add(8)
        sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), cb = sp.self_entry_point('doAccrueInterest'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getBorrowRate').open_some())
      self.data.isAccrualInterestValid = True

    @sp.entry_point
    def addReserves(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(11)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(sp.record(addAmount = params, originalSender = sp.sender), sp.amount, sp.self_entry_point('addReservesInternal'))

    @sp.entry_point
    def addReservesInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(11), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(11)
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.verify(sp.fst(sp.ediv(sp.amount, sp.mutez(1)).open_some(message = sp.unit)) == params.addAmount, 'CT_INVALID_MUTEZ')
      self.data.totalReserves += params.addAmount
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def approve(self, params):
      sp.set_type(params, sp.TRecord(spender = sp.TAddress, value = sp.TNat).layout(("spender", "value")))
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.verify((self.data.balances[sp.sender].approvals.get(params.spender, default_value = 0) == 0) | (params.value == 0), 'CT_UNSAFE_ALLOWANCE_CHANGE')
      self.data.balances[sp.sender].approvals[params.spender] = params.value

    @sp.entry_point
    def borrow(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, borrower = sp.sender, borrowAmount = params), sp.tez(0), sp.contract(sp.TRecord(borrowAmount = sp.TNat, borrower = sp.TAddress, cToken = sp.TAddress).layout(("cToken", ("borrower", "borrowAmount"))), self.data.comptroller, entry_point='borrowAllowed').open_some())
      sp.verify(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) >= params, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.if False:
        sp.transfer(sp.unit, sp.mul(params, sp.mutez(1)), sp.contract(sp.TUnit, sp.sender, entry_point='receive').open_some(message = 'bad contract destination'))
      sp.else:
        sp.send(sp.sender, sp.mul(params, sp.mutez(1)))
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.sender].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      self.data.balances[sp.sender].accountBorrows.principal = borrowBalance.value + params
      self.data.balances[sp.sender].accountBorrows.interestIndex = self.data.borrowIndex
      self.data.totalBorrows += borrowBalance.value + params
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def borrowBalanceStored(self, params):
      sp.set_type(sp.fst(params), sp.TAddress)
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.fst(params)].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      __s2 = sp.local("__s2", borrowBalance.value)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s2.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def doAccrueInterest(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(8), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(8)
      sp.verify(params <= self.data.borrowRateMaxMantissa, 'CT_INVALID_BORROW_RATE')
      sp.set_type(params, sp.TNat)
      sp.set_type(sp.record(mantissa = params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.as_nat(sp.level - self.data.accrualBlockNumber), sp.TNat)
      sp.set_type(params * sp.as_nat(sp.level - self.data.accrualBlockNumber), sp.TNat)
      compute_CToken_545 = sp.local("compute_CToken_545", sp.record(mantissa = params * sp.as_nat(sp.level - self.data.accrualBlockNumber)))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(compute_CToken_545.value.mantissa * self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.record(mantissa = compute_CToken_545.value.mantissa * self.data.totalBorrows), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      compute_CToken_546 = sp.local("compute_CToken_546", (compute_CToken_545.value.mantissa * self.data.totalBorrows) // self.data.expScale)
      self.data.totalBorrows = compute_CToken_546.value + self.data.totalBorrows
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_546.value, sp.TNat)
      sp.set_type(self.data.totalReserves, sp.TNat)
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_546.value, sp.TNat)
      sp.set_type(self.data.reserveFactorMantissa * compute_CToken_546.value, sp.TNat)
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa * compute_CToken_546.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      self.data.totalReserves = ((self.data.reserveFactorMantissa * compute_CToken_546.value) // self.data.expScale) + self.data.totalReserves
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(compute_CToken_545.value.mantissa * self.data.borrowIndex, sp.TNat)
      sp.set_type(sp.record(mantissa = compute_CToken_545.value.mantissa * self.data.borrowIndex), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      self.data.borrowIndex = ((compute_CToken_545.value.mantissa * self.data.borrowIndex) // self.data.expScale) + self.data.borrowIndex
      self.data.accrualBlockNumber = sp.level

    @sp.entry_point
    def exchangeRateStored(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      __s3 = sp.local("__s3", excRate.value)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s3.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getAccountSnapshot(self, params):
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.fst(params)].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      __s4 = sp.local("__s4", sp.record(account = sp.fst(params), borrowBalance = borrowBalance.value, cTokenBalance = self.data.balances[sp.fst(params)].balance, exchangeRateMantissa = excRate.value))
      sp.set_type(sp.snd(params), sp.TContract(sp.TRecord(account = sp.TAddress, borrowBalance = sp.TNat, cTokenBalance = sp.TNat, exchangeRateMantissa = sp.TNat).layout((("account", "borrowBalance"), ("cTokenBalance", "exchangeRateMantissa")))))
      sp.transfer(__s4.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getAllowance(self, params):
      __s5 = sp.local("__s5", self.data.balances[sp.fst(params).owner].approvals[sp.fst(params).spender])
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s5.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getBalance(self, params):
      __s6 = sp.local("__s6", self.data.balances[sp.fst(params)].balance)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s6.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getBalanceOfUnderlying(self, params):
      sp.set_type(sp.fst(params), sp.TAddress)
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      sp.set_type(excRate.value, sp.TNat)
      sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.balances[sp.fst(params)].balance, sp.TNat)
      sp.set_type(excRate.value * self.data.balances[sp.fst(params)].balance, sp.TNat)
      sp.set_type(sp.record(mantissa = excRate.value * self.data.balances[sp.fst(params)].balance), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      __s7 = sp.local("__s7", (excRate.value * self.data.balances[sp.fst(params)].balance) // self.data.expScale)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s7.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getCash(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      __s8 = sp.local("__s8", sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)))
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s8.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getTotalSupply(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      __s9 = sp.local("__s9", self.data.totalSupply)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s9.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def hardResetOp(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.activeOperations = sp.set([])

    @sp.entry_point
    def mint(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, minter = sp.sender, mintAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, mintAmount = sp.TNat, minter = sp.TAddress).layout(("cToken", ("minter", "mintAmount"))), self.data.comptroller, entry_point='mintAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.verify(sp.fst(sp.ediv(sp.amount, sp.mutez(1)).open_some(message = sp.unit)) == params, 'CT_INVALID_MUTEZ')
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), sp.TNat)
        sp.set_type(params, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - params, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - params, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - params, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - params, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - params, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      amount = sp.local("amount", 0)
      sp.if True:
        sp.set_type(excRate.value, sp.TNat)
        sp.set_type(params, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
        compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
        amount.value = compute_CToken_747.value
      sp.else:
        sp.set_type(excRate.value, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(params, sp.TNat)
        sp.set_type(excRate.value * params, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
        amount.value = compute_CToken_749.value
      self.data.totalSupply += amount.value
      self.data.balances[sp.sender].balance += amount.value
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def redeem(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.transfer(sp.record(cToken = sp.self_address, redeemer = sp.sender, redeemAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, redeemAmount = sp.TNat, redeemer = sp.TAddress).layout(("cToken", ("redeemer", "redeemAmount"))), self.data.comptroller, entry_point='redeemAllowed').open_some())
      redeem_amount = sp.local("redeem_amount", 0)
      sp.if False:
        redeem_amount.value = params
      sp.else:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if False:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_amount.value = amount.value
      redeem_tokens = sp.local("redeem_tokens", 0)
      sp.if False:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if True:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_tokens.value = amount.value
      sp.else:
        redeem_tokens.value = params
      sp.verify(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) >= redeem_amount.value, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      self.data.totalSupply = sp.as_nat(self.data.totalSupply - redeem_tokens.value, message = 'Insufficient supply')
      self.data.balances[sp.sender].balance = sp.as_nat(self.data.balances[sp.sender].balance - redeem_tokens.value, message = 'Insufficient balance')
      sp.if False:
        sp.transfer(sp.unit, sp.mul(redeem_amount.value, sp.mutez(1)), sp.contract(sp.TUnit, sp.sender, entry_point='receive').open_some(message = 'bad contract destination'))
      sp.else:
        sp.send(sp.sender, sp.mul(redeem_amount.value, sp.mutez(1)))
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def redeemUnderlying(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.transfer(sp.record(cToken = sp.self_address, redeemer = sp.sender, redeemAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, redeemAmount = sp.TNat, redeemer = sp.TAddress).layout(("cToken", ("redeemer", "redeemAmount"))), self.data.comptroller, entry_point='redeemAllowed').open_some())
      redeem_amount = sp.local("redeem_amount", 0)
      sp.if True:
        redeem_amount.value = params
      sp.else:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if False:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_amount.value = amount.value
      redeem_tokens = sp.local("redeem_tokens", 0)
      sp.if True:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if True:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_tokens.value = amount.value
      sp.else:
        redeem_tokens.value = params
      sp.verify(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) >= redeem_amount.value, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      self.data.totalSupply = sp.as_nat(self.data.totalSupply - redeem_tokens.value, message = 'Insufficient supply')
      self.data.balances[sp.sender].balance = sp.as_nat(self.data.balances[sp.sender].balance - redeem_tokens.value, message = 'Insufficient balance')
      sp.if False:
        sp.transfer(sp.unit, sp.mul(redeem_amount.value, sp.mutez(1)), sp.contract(sp.TUnit, sp.sender, entry_point='receive').open_some(message = 'bad contract destination'))
      sp.else:
        sp.send(sp.sender, sp.mul(redeem_amount.value, sp.mutez(1)))
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def reduceReserves(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(12)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.amount, sp.self_entry_point('reduceReservesInternal'))

    @sp.entry_point
    def reduceReservesInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(12), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(12)
      sp.verify(sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)) >= params, 'CT_INSUFFICIENT_CASH')
      sp.verify(params <= self.data.totalReserves, 'CT_REDUCE_AMOUNT')
      sp.set_type(self.data.totalReserves, sp.TNat)
      sp.set_type(params, sp.TNat)
      self.data.totalReserves = sp.as_nat(self.data.totalReserves - params, message = 'SUBTRACTION_UNDERFLOW')
      sp.if True:
        sp.transfer(sp.unit, sp.mul(params, sp.mutez(1)), sp.contract(sp.TUnit, self.data.administrator, entry_point='receive').open_some(message = 'bad contract destination'))
      sp.else:
        sp.send(self.data.administrator, sp.mul(params, sp.mutez(1)))
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def removePendingGovernance(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.pendingAdministrator = sp.none

    @sp.entry_point
    def repayBorrow(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, payer = sp.sender, borrower = sp.sender, repayAmount = params), sp.tez(0), sp.contract(sp.TRecord(borrower = sp.TAddress, cToken = sp.TAddress, payer = sp.TAddress, repayAmount = sp.TNat).layout(("cToken", ("payer", ("borrower", "repayAmount")))), self.data.comptroller, entry_point='repayBorrowAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.sender].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      sp.verify(sp.fst(sp.ediv(sp.amount, sp.mutez(1)).open_some(message = sp.unit)) == sp.min(borrowBalance.value, params), 'CT_INVALID_MUTEZ')
      sp.set_type(borrowBalance.value, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params), sp.TNat)
      self.data.balances[sp.sender].accountBorrows.principal = sp.as_nat(borrowBalance.value - sp.min(borrowBalance.value, params), message = 'SUBTRACTION_UNDERFLOW')
      self.data.balances[sp.sender].accountBorrows.interestIndex = self.data.borrowIndex
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params), sp.TNat)
      self.data.totalBorrows = sp.as_nat(self.data.totalBorrows - sp.min(borrowBalance.value, params), message = 'SUBTRACTION_UNDERFLOW')
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def repayBorrowBehalf(self, params):
      sp.set_type(params, sp.TRecord(borrower = sp.TAddress, repayAmount = sp.TNat).layout(("borrower", "repayAmount")))
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, payer = sp.sender, borrower = params.borrower, repayAmount = params.repayAmount), sp.tez(0), sp.contract(sp.TRecord(borrower = sp.TAddress, cToken = sp.TAddress, payer = sp.TAddress, repayAmount = sp.TNat).layout(("cToken", ("payer", ("borrower", "repayAmount")))), self.data.comptroller, entry_point='repayBorrowAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[params.borrower].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      sp.verify(sp.fst(sp.ediv(sp.amount, sp.mutez(1)).open_some(message = sp.unit)) == sp.min(borrowBalance.value, params.repayAmount), 'CT_INVALID_MUTEZ')
      sp.set_type(borrowBalance.value, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params.repayAmount), sp.TNat)
      self.data.balances[params.borrower].accountBorrows.principal = sp.as_nat(borrowBalance.value - sp.min(borrowBalance.value, params.repayAmount), message = 'SUBTRACTION_UNDERFLOW')
      self.data.balances[params.borrower].accountBorrows.interestIndex = self.data.borrowIndex
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params.repayAmount), sp.TNat)
      self.data.totalBorrows = sp.as_nat(self.data.totalBorrows - sp.min(borrowBalance.value, params.repayAmount), message = 'SUBTRACTION_UNDERFLOW')
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def setAccrualIntPeriodRelevance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.set_type(params, sp.TNat)
      self.data.accrualIntPeriodRelevance = params

    @sp.entry_point
    def setBorrowRatePerBlock(self, params):
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(6), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(6)
      self.data.borrowRatePerBlock = params

    @sp.entry_point
    def setComptroller(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.comptroller = params

    @sp.entry_point
    def setInterestRateModel(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(9)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.tez(0), sp.self_entry_point('setInterestRateModelInternal'))

    @sp.entry_point
    def setInterestRateModelInternal(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(9), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(9)
      self.data.interestRateModel = params

    @sp.entry_point
    def setPendingGovernance(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.pendingAdministrator = sp.some(params)

    @sp.entry_point
    def setReserveFactor(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(10)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.tez(0), sp.self_entry_point('setReserveFactorInternal'))

    @sp.entry_point
    def setReserveFactorInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(10), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(10)
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.verify(params <= self.data.reserveFactorMaxMantissa, 'CT_INVALID_RESERVE_FACTOR')
      self.data.reserveFactorMantissa = params
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def setSupplyRatePerBlock(self, params):
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(7), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(7)
      self.data.supplyRatePerBlock = params

    @sp.entry_point
    def sweepFA12(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", "tokenAddress")))
      sp.transfer(sp.record(from_ = sp.self_address, to_ = self.data.administrator, value = params.amount), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepFA2(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, id = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", ("id", "tokenAddress"))))
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = self.data.administrator, token_id = params.id, amount = params.amount)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepMutez(self, params):
      sp.set_type(params, sp.TBool)
      sp.verify(False, 'CT_SWEEP_XTZ')
      sp.if params:
        sp.send(self.data.administrator, sp.balance)
      sp.else:
        sp.send(self.data.administrator, sp.balance)

    @sp.entry_point
    def transfer(self, params):
      sp.set_type(params, sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))))
      sp.verify((params.from_ == sp.sender) | (self.data.balances[params.from_].approvals[sp.sender] >= params.value), 'CT_TRANSFER_NOT_APPROVED')
      sp.if ~ (self.data.balances.contains(params.to_)):
        self.data.balances[params.to_] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, src = params.from_, dst = params.to_, transferTokens = params.value), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, dst = sp.TAddress, src = sp.TAddress, transferTokens = sp.TNat).layout((("cToken", "src"), ("dst", "transferTokens"))), self.data.comptroller, entry_point='transferAllowed').open_some())
      sp.set_type(sp.record(from_ = params.from_, sender = sp.sender, to_ = params.to_, value = params.value), sp.TRecord(from_ = sp.TAddress, sender = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout((("from_", "sender"), ("to_", "value"))))
      sp.verify(self.data.balances[params.from_].balance >= params.value, 'CT_INSUFFICIENT_BALANCE')
      self.data.balances[params.from_].balance = sp.as_nat(self.data.balances[params.from_].balance - params.value)
      self.data.balances[params.to_].balance += params.value
      sp.if params.from_ != sp.sender:
        self.data.balances[params.from_].approvals[sp.sender] = sp.as_nat(self.data.balances[params.from_].approvals[sp.sender] - params.value)

    @sp.entry_point
    def updateBorrowRateInternal(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(6), 'OP_NOT_ACTIVE')
      sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), cb = sp.self_entry_point('setBorrowRatePerBlock'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getBorrowRate').open_some())

    @sp.entry_point
    def updateBorrowRatePerBlock(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(6)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('updateBorrowRateInternal'))

    @sp.entry_point
    def updateSupplyRateInternal(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(7), 'OP_NOT_ACTIVE')
      sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = sp.fst(sp.ediv(sp.balance, sp.mutez(1)).open_some(message = sp.unit)), cb = sp.self_entry_point('setSupplyRatePerBlock'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getSupplyRate').open_some())

    @sp.entry_point
    def updateSupplyRatePerBlock(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(7)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('updateSupplyRateInternal'))
    Contract

    New contract: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    Balance: 0.000000tz

    Storage:

    Balances
    Key Approvals Balance

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(balances = sp.TBigMap(sp.TAddress, sp.TRecord(approvals = sp.TMap(sp.TAddress, sp.TNat), balance = sp.TNat).layout(("approvals", "balance")))).layout("balances"))
      self.init(balances = {})


    @sp.entry_point
    def approve(self, params):
      sp.set_type(params, sp.TRecord(spender = sp.TAddress, value = sp.TNat).layout(("spender", "value")))
      self.data.balances[sp.sender].approvals[params.spender] = params.value

    @sp.entry_point
    def getBalance(self, params):
      __s10 = sp.local("__s10", self.data.balances[sp.fst(params)].balance)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s10.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def mint(self, params):
      sp.set_type(params, sp.TRecord(address = sp.TAddress, value = sp.TNat).layout(("address", "value")))
      sp.if ~ (self.data.balances.contains(params.address)):
        self.data.balances[params.address] = sp.record(approvals = {}, balance = 0)
      self.data.balances[params.address].balance += params.value

    @sp.entry_point
    def transfer(self, params):
      sp.set_type(params, sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))))
      sp.verify((params.from_ == sp.sender) | (self.data.balances[params.from_].approvals[sp.sender] >= params.value))
      sp.if ~ (self.data.balances.contains(params.to_)):
        self.data.balances[params.to_] = sp.record(approvals = {}, balance = 0)
      sp.verify(self.data.balances[params.from_].balance >= params.value)
      self.data.balances[params.from_].balance = sp.as_nat(self.data.balances[params.from_].balance - params.value)
      self.data.balances[params.to_].balance += params.value
      sp.if params.from_ != sp.sender:
        self.data.balances[params.from_].approvals[sp.sender] = sp.as_nat(self.data.balances[params.from_].approvals[sp.sender] - params.value)
    Contract

    New contract: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(accrualBlockNumber = sp.TNat, accrualIntPeriodRelevance = sp.TNat, activeOperations = sp.TSet(sp.TNat), administrator = sp.TAddress, balances = sp.TBigMap(sp.TAddress, sp.TRecord(accountBorrows = sp.TRecord(interestIndex = sp.TNat, principal = sp.TNat).layout(("interestIndex", "principal")), approvals = sp.TMap(sp.TAddress, sp.TNat), balance = sp.TNat).layout(("accountBorrows", ("approvals", "balance")))), borrowIndex = sp.TNat, borrowRateMaxMantissa = sp.TNat, borrowRatePerBlock = sp.TNat, comptroller = sp.TAddress, currentCash = sp.TNat, expScale = sp.TNat, fa1_2_TokenAddress = sp.TAddress, halfExpScale = sp.TNat, initialExchangeRateMantissa = sp.TNat, interestRateModel = sp.TAddress, isAccrualInterestValid = sp.TBool, pendingAdministrator = sp.TOption(sp.TAddress), reserveFactorMantissa = sp.TNat, reserveFactorMaxMantissa = sp.TNat, supplyRatePerBlock = sp.TNat, totalBorrows = sp.TNat, totalReserves = sp.TNat, totalSupply = sp.TNat).layout((((("accrualBlockNumber", "accrualIntPeriodRelevance"), ("activeOperations", ("administrator", "balances"))), (("borrowIndex", ("borrowRateMaxMantissa", "borrowRatePerBlock")), ("comptroller", ("currentCash", "expScale")))), ((("fa1_2_TokenAddress", ("halfExpScale", "initialExchangeRateMantissa")), ("interestRateModel", ("isAccrualInterestValid", "pendingAdministrator"))), (("reserveFactorMantissa", ("reserveFactorMaxMantissa", "supplyRatePerBlock")), ("totalBorrows", ("totalReserves", "totalSupply")))))))
      self.init(accrualBlockNumber = 0,
                accrualIntPeriodRelevance = 5,
                activeOperations = sp.set([]),
                administrator = sp.address('KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1'),
                balances = {},
                borrowIndex = 1000000000000000000,
                borrowRateMaxMantissa = 5000000000000,
                borrowRatePerBlock = 0,
                comptroller = sp.address('KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF'),
                currentCash = 0,
                expScale = 1000000000000000000,
                fa1_2_TokenAddress = sp.address('KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC'),
                halfExpScale = 500000000000000000,
                initialExchangeRateMantissa = 1000000000000,
                interestRateModel = sp.address('KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H'),
                isAccrualInterestValid = False,
                pendingAdministrator = sp.none,
                reserveFactorMantissa = 0,
                reserveFactorMaxMantissa = 1000000000000000000,
                supplyRatePerBlock = 0,
                totalBorrows = 0,
                totalReserves = 0,
                totalSupply = 0)


    @sp.entry_point
    def acceptGovernance(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.pendingAdministrator.open_some(message = 'CT_NOT_SET_PENDING_ADMIN'), 'CT_NOT_PENDING_ADMIN')
      self.data.administrator = self.data.pendingAdministrator.open_some()
      self.data.pendingAdministrator = sp.none

    @sp.entry_point
    def accrueInterest(self, params):
      sp.set_type(params, sp.TUnit)
      compute_CFA12_24 = sp.local("compute_CFA12_24", (self.data.currentCash + self.data.totalSupply) + self.data.totalReserves)
      sp.if compute_CFA12_24.value > 0:
        self.data.activeOperations.add(13)
        sp.transfer((sp.self_address, sp.self_entry_point('setCash')), sp.tez(0), sp.contract(sp.TPair(sp.TAddress, sp.TContract(sp.TNat)), self.data.fa1_2_TokenAddress, entry_point='getBalance').open_some())
      sp.if self.data.accrualBlockNumber == 0:
        self.data.accrualBlockNumber = sp.level
      sp.if sp.level != self.data.accrualBlockNumber:
        self.data.activeOperations.add(8)
        sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = self.data.currentCash, cb = sp.self_entry_point('doAccrueInterest'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getBorrowRate').open_some())
      self.data.isAccrualInterestValid = True

    @sp.entry_point
    def addReserves(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(11)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(sp.record(addAmount = params, originalSender = sp.sender), sp.amount, sp.self_entry_point('addReservesInternal'))

    @sp.entry_point
    def addReservesInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(11), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(11)
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.transfer(sp.record(from_ = params.originalSender, to_ = sp.self_address, value = params.addAmount), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), self.data.fa1_2_TokenAddress, entry_point='transfer').open_some())
      self.data.totalReserves += params.addAmount
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def approve(self, params):
      sp.set_type(params, sp.TRecord(spender = sp.TAddress, value = sp.TNat).layout(("spender", "value")))
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.verify((self.data.balances[sp.sender].approvals.get(params.spender, default_value = 0) == 0) | (params.value == 0), 'CT_UNSAFE_ALLOWANCE_CHANGE')
      self.data.balances[sp.sender].approvals[params.spender] = params.value

    @sp.entry_point
    def borrow(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, borrower = sp.sender, borrowAmount = params), sp.tez(0), sp.contract(sp.TRecord(borrowAmount = sp.TNat, borrower = sp.TAddress, cToken = sp.TAddress).layout(("cToken", ("borrower", "borrowAmount"))), self.data.comptroller, entry_point='borrowAllowed').open_some())
      sp.verify(self.data.currentCash >= params, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.transfer(sp.record(from_ = sp.self_address, to_ = sp.sender, value = params), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), self.data.fa1_2_TokenAddress, entry_point='transfer').open_some())
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.sender].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      self.data.balances[sp.sender].accountBorrows.principal = borrowBalance.value + params
      self.data.balances[sp.sender].accountBorrows.interestIndex = self.data.borrowIndex
      self.data.totalBorrows += borrowBalance.value + params
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def borrowBalanceStored(self, params):
      sp.set_type(sp.fst(params), sp.TAddress)
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.fst(params)].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      __s11 = sp.local("__s11", borrowBalance.value)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s11.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def doAccrueInterest(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(8), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(8)
      sp.verify(params <= self.data.borrowRateMaxMantissa, 'CT_INVALID_BORROW_RATE')
      sp.set_type(params, sp.TNat)
      sp.set_type(sp.record(mantissa = params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.as_nat(sp.level - self.data.accrualBlockNumber), sp.TNat)
      sp.set_type(params * sp.as_nat(sp.level - self.data.accrualBlockNumber), sp.TNat)
      compute_CToken_545 = sp.local("compute_CToken_545", sp.record(mantissa = params * sp.as_nat(sp.level - self.data.accrualBlockNumber)))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(compute_CToken_545.value.mantissa * self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.record(mantissa = compute_CToken_545.value.mantissa * self.data.totalBorrows), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      compute_CToken_546 = sp.local("compute_CToken_546", (compute_CToken_545.value.mantissa * self.data.totalBorrows) // self.data.expScale)
      self.data.totalBorrows = compute_CToken_546.value + self.data.totalBorrows
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_546.value, sp.TNat)
      sp.set_type(self.data.totalReserves, sp.TNat)
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_546.value, sp.TNat)
      sp.set_type(self.data.reserveFactorMantissa * compute_CToken_546.value, sp.TNat)
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa * compute_CToken_546.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      self.data.totalReserves = ((self.data.reserveFactorMantissa * compute_CToken_546.value) // self.data.expScale) + self.data.totalReserves
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(compute_CToken_545.value.mantissa * self.data.borrowIndex, sp.TNat)
      sp.set_type(sp.record(mantissa = compute_CToken_545.value.mantissa * self.data.borrowIndex), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      self.data.borrowIndex = ((compute_CToken_545.value.mantissa * self.data.borrowIndex) // self.data.expScale) + self.data.borrowIndex
      self.data.accrualBlockNumber = sp.level

    @sp.entry_point
    def exchangeRateStored(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(self.data.currentCash, sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      __s12 = sp.local("__s12", excRate.value)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s12.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getAccountSnapshot(self, params):
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.fst(params)].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(self.data.currentCash, sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      __s13 = sp.local("__s13", sp.record(account = sp.fst(params), borrowBalance = borrowBalance.value, cTokenBalance = self.data.balances[sp.fst(params)].balance, exchangeRateMantissa = excRate.value))
      sp.set_type(sp.snd(params), sp.TContract(sp.TRecord(account = sp.TAddress, borrowBalance = sp.TNat, cTokenBalance = sp.TNat, exchangeRateMantissa = sp.TNat).layout((("account", "borrowBalance"), ("cTokenBalance", "exchangeRateMantissa")))))
      sp.transfer(__s13.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getAllowance(self, params):
      __s14 = sp.local("__s14", self.data.balances[sp.fst(params).owner].approvals[sp.fst(params).spender])
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s14.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getBalance(self, params):
      __s15 = sp.local("__s15", self.data.balances[sp.fst(params)].balance)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s15.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getBalanceOfUnderlying(self, params):
      sp.set_type(sp.fst(params), sp.TAddress)
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(self.data.currentCash, sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      sp.set_type(excRate.value, sp.TNat)
      sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.balances[sp.fst(params)].balance, sp.TNat)
      sp.set_type(excRate.value * self.data.balances[sp.fst(params)].balance, sp.TNat)
      sp.set_type(sp.record(mantissa = excRate.value * self.data.balances[sp.fst(params)].balance), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      __s16 = sp.local("__s16", (excRate.value * self.data.balances[sp.fst(params)].balance) // self.data.expScale)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s16.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getCash(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      __s17 = sp.local("__s17", self.data.currentCash)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s17.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getTotalSupply(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      __s18 = sp.local("__s18", self.data.totalSupply)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s18.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def hardResetOp(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.activeOperations = sp.set([])

    @sp.entry_point
    def mint(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, minter = sp.sender, mintAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, mintAmount = sp.TNat, minter = sp.TAddress).layout(("cToken", ("minter", "mintAmount"))), self.data.comptroller, entry_point='mintAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.transfer(sp.record(from_ = sp.sender, to_ = sp.self_address, value = params), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), self.data.fa1_2_TokenAddress, entry_point='transfer').open_some())
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(self.data.currentCash, sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      amount = sp.local("amount", 0)
      sp.if True:
        sp.set_type(excRate.value, sp.TNat)
        sp.set_type(params, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
        compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
        amount.value = compute_CToken_747.value
      sp.else:
        sp.set_type(excRate.value, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(params, sp.TNat)
        sp.set_type(excRate.value * params, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
        amount.value = compute_CToken_749.value
      self.data.totalSupply += amount.value
      self.data.balances[sp.sender].balance += amount.value
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def redeem(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.transfer(sp.record(cToken = sp.self_address, redeemer = sp.sender, redeemAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, redeemAmount = sp.TNat, redeemer = sp.TAddress).layout(("cToken", ("redeemer", "redeemAmount"))), self.data.comptroller, entry_point='redeemAllowed').open_some())
      redeem_amount = sp.local("redeem_amount", 0)
      sp.if False:
        redeem_amount.value = params
      sp.else:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(self.data.currentCash, sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if False:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_amount.value = amount.value
      redeem_tokens = sp.local("redeem_tokens", 0)
      sp.if False:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(self.data.currentCash, sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if True:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_tokens.value = amount.value
      sp.else:
        redeem_tokens.value = params
      sp.verify(self.data.currentCash >= redeem_amount.value, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      self.data.totalSupply = sp.as_nat(self.data.totalSupply - redeem_tokens.value, message = 'Insufficient supply')
      self.data.balances[sp.sender].balance = sp.as_nat(self.data.balances[sp.sender].balance - redeem_tokens.value, message = 'Insufficient balance')
      sp.transfer(sp.record(from_ = sp.self_address, to_ = sp.sender, value = redeem_amount.value), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), self.data.fa1_2_TokenAddress, entry_point='transfer').open_some())
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def redeemUnderlying(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.transfer(sp.record(cToken = sp.self_address, redeemer = sp.sender, redeemAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, redeemAmount = sp.TNat, redeemer = sp.TAddress).layout(("cToken", ("redeemer", "redeemAmount"))), self.data.comptroller, entry_point='redeemAllowed').open_some())
      redeem_amount = sp.local("redeem_amount", 0)
      sp.if True:
        redeem_amount.value = params
      sp.else:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(self.data.currentCash, sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if False:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_amount.value = amount.value
      redeem_tokens = sp.local("redeem_tokens", 0)
      sp.if True:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(self.data.currentCash, sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if True:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_tokens.value = amount.value
      sp.else:
        redeem_tokens.value = params
      sp.verify(self.data.currentCash >= redeem_amount.value, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      self.data.totalSupply = sp.as_nat(self.data.totalSupply - redeem_tokens.value, message = 'Insufficient supply')
      self.data.balances[sp.sender].balance = sp.as_nat(self.data.balances[sp.sender].balance - redeem_tokens.value, message = 'Insufficient balance')
      sp.transfer(sp.record(from_ = sp.self_address, to_ = sp.sender, value = redeem_amount.value), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), self.data.fa1_2_TokenAddress, entry_point='transfer').open_some())
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def reduceReserves(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(12)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.amount, sp.self_entry_point('reduceReservesInternal'))

    @sp.entry_point
    def reduceReservesInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(12), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(12)
      sp.verify(self.data.currentCash >= params, 'CT_INSUFFICIENT_CASH')
      sp.verify(params <= self.data.totalReserves, 'CT_REDUCE_AMOUNT')
      sp.set_type(self.data.totalReserves, sp.TNat)
      sp.set_type(params, sp.TNat)
      self.data.totalReserves = sp.as_nat(self.data.totalReserves - params, message = 'SUBTRACTION_UNDERFLOW')
      sp.transfer(sp.record(from_ = sp.self_address, to_ = self.data.administrator, value = params), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), self.data.fa1_2_TokenAddress, entry_point='transfer').open_some())
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def removePendingGovernance(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.pendingAdministrator = sp.none

    @sp.entry_point
    def repayBorrow(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, payer = sp.sender, borrower = sp.sender, repayAmount = params), sp.tez(0), sp.contract(sp.TRecord(borrower = sp.TAddress, cToken = sp.TAddress, payer = sp.TAddress, repayAmount = sp.TNat).layout(("cToken", ("payer", ("borrower", "repayAmount")))), self.data.comptroller, entry_point='repayBorrowAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.sender].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      sp.transfer(sp.record(from_ = sp.sender, to_ = sp.self_address, value = sp.min(borrowBalance.value, params)), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), self.data.fa1_2_TokenAddress, entry_point='transfer').open_some())
      sp.set_type(borrowBalance.value, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params), sp.TNat)
      self.data.balances[sp.sender].accountBorrows.principal = sp.as_nat(borrowBalance.value - sp.min(borrowBalance.value, params), message = 'SUBTRACTION_UNDERFLOW')
      self.data.balances[sp.sender].accountBorrows.interestIndex = self.data.borrowIndex
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params), sp.TNat)
      self.data.totalBorrows = sp.as_nat(self.data.totalBorrows - sp.min(borrowBalance.value, params), message = 'SUBTRACTION_UNDERFLOW')
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def repayBorrowBehalf(self, params):
      sp.set_type(params, sp.TRecord(borrower = sp.TAddress, repayAmount = sp.TNat).layout(("borrower", "repayAmount")))
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, payer = sp.sender, borrower = params.borrower, repayAmount = params.repayAmount), sp.tez(0), sp.contract(sp.TRecord(borrower = sp.TAddress, cToken = sp.TAddress, payer = sp.TAddress, repayAmount = sp.TNat).layout(("cToken", ("payer", ("borrower", "repayAmount")))), self.data.comptroller, entry_point='repayBorrowAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[params.borrower].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      sp.transfer(sp.record(from_ = sp.sender, to_ = sp.self_address, value = sp.min(borrowBalance.value, params.repayAmount)), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), self.data.fa1_2_TokenAddress, entry_point='transfer').open_some())
      sp.set_type(borrowBalance.value, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params.repayAmount), sp.TNat)
      self.data.balances[params.borrower].accountBorrows.principal = sp.as_nat(borrowBalance.value - sp.min(borrowBalance.value, params.repayAmount), message = 'SUBTRACTION_UNDERFLOW')
      self.data.balances[params.borrower].accountBorrows.interestIndex = self.data.borrowIndex
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params.repayAmount), sp.TNat)
      self.data.totalBorrows = sp.as_nat(self.data.totalBorrows - sp.min(borrowBalance.value, params.repayAmount), message = 'SUBTRACTION_UNDERFLOW')
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def setAccrualIntPeriodRelevance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.set_type(params, sp.TNat)
      self.data.accrualIntPeriodRelevance = params

    @sp.entry_point
    def setBorrowRatePerBlock(self, params):
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(6), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(6)
      self.data.borrowRatePerBlock = params

    @sp.entry_point
    def setCash(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(self.data.activeOperations.contains(13), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(13)
      sp.verify(sp.sender == self.data.fa1_2_TokenAddress, 'CT_INVALID_CASH_SENDER')
      self.data.currentCash = params

    @sp.entry_point
    def setComptroller(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.comptroller = params

    @sp.entry_point
    def setInterestRateModel(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(9)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.tez(0), sp.self_entry_point('setInterestRateModelInternal'))

    @sp.entry_point
    def setInterestRateModelInternal(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(9), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(9)
      self.data.interestRateModel = params

    @sp.entry_point
    def setPendingGovernance(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.pendingAdministrator = sp.some(params)

    @sp.entry_point
    def setReserveFactor(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(10)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.tez(0), sp.self_entry_point('setReserveFactorInternal'))

    @sp.entry_point
    def setReserveFactorInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(10), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(10)
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.verify(params <= self.data.reserveFactorMaxMantissa, 'CT_INVALID_RESERVE_FACTOR')
      self.data.reserveFactorMantissa = params
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def setSupplyRatePerBlock(self, params):
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(7), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(7)
      self.data.supplyRatePerBlock = params

    @sp.entry_point
    def sweepFA12(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", "tokenAddress")))
      sp.verify(params.tokenAddress != self.data.fa1_2_TokenAddress, 'CT_SWEEP_UNDERLYING')
      sp.transfer(sp.record(from_ = sp.self_address, to_ = self.data.administrator, value = params.amount), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepFA2(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, id = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", ("id", "tokenAddress"))))
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = self.data.administrator, token_id = params.id, amount = params.amount)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepMutez(self, params):
      sp.set_type(params, sp.TBool)
      sp.if params:
        sp.send(self.data.administrator, sp.balance)
      sp.else:
        sp.send(self.data.administrator, sp.balance)

    @sp.entry_point
    def transfer(self, params):
      sp.set_type(params, sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))))
      sp.verify((params.from_ == sp.sender) | (self.data.balances[params.from_].approvals[sp.sender] >= params.value), 'CT_TRANSFER_NOT_APPROVED')
      sp.if ~ (self.data.balances.contains(params.to_)):
        self.data.balances[params.to_] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, src = params.from_, dst = params.to_, transferTokens = params.value), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, dst = sp.TAddress, src = sp.TAddress, transferTokens = sp.TNat).layout((("cToken", "src"), ("dst", "transferTokens"))), self.data.comptroller, entry_point='transferAllowed').open_some())
      sp.set_type(sp.record(from_ = params.from_, sender = sp.sender, to_ = params.to_, value = params.value), sp.TRecord(from_ = sp.TAddress, sender = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout((("from_", "sender"), ("to_", "value"))))
      sp.verify(self.data.balances[params.from_].balance >= params.value, 'CT_INSUFFICIENT_BALANCE')
      self.data.balances[params.from_].balance = sp.as_nat(self.data.balances[params.from_].balance - params.value)
      self.data.balances[params.to_].balance += params.value
      sp.if params.from_ != sp.sender:
        self.data.balances[params.from_].approvals[sp.sender] = sp.as_nat(self.data.balances[params.from_].approvals[sp.sender] - params.value)

    @sp.entry_point
    def updateBorrowRateInternal(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(6), 'OP_NOT_ACTIVE')
      sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = self.data.currentCash, cb = sp.self_entry_point('setBorrowRatePerBlock'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getBorrowRate').open_some())

    @sp.entry_point
    def updateBorrowRatePerBlock(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(6)
      compute_CFA12_24 = sp.local("compute_CFA12_24", (self.data.currentCash + self.data.totalSupply) + self.data.totalReserves)
      sp.if compute_CFA12_24.value > 0:
        self.data.activeOperations.add(13)
        sp.transfer((sp.self_address, sp.self_entry_point('setCash')), sp.tez(0), sp.contract(sp.TPair(sp.TAddress, sp.TContract(sp.TNat)), self.data.fa1_2_TokenAddress, entry_point='getBalance').open_some())
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('updateBorrowRateInternal'))

    @sp.entry_point
    def updateSupplyRateInternal(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(7), 'OP_NOT_ACTIVE')
      sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = self.data.currentCash, cb = sp.self_entry_point('setSupplyRatePerBlock'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getSupplyRate').open_some())

    @sp.entry_point
    def updateSupplyRatePerBlock(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(7)
      compute_CFA12_24 = sp.local("compute_CFA12_24", (self.data.currentCash + self.data.totalSupply) + self.data.totalReserves)
      sp.if compute_CFA12_24.value > 0:
        self.data.activeOperations.add(13)
        sp.transfer((sp.self_address, sp.self_entry_point('setCash')), sp.tez(0), sp.contract(sp.TPair(sp.TAddress, sp.TContract(sp.TNat)), self.data.fa1_2_TokenAddress, entry_point='getBalance').open_some())
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('updateSupplyRateInternal'))
    Contract

    New contract: KT1Tezooo6zzSmartPyzzSTATiCzzztY1196

    Balance: 0.000000tz

    Storage:

    Price

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(price = sp.TNat).layout("price"))
      self.init(price = 0)


    @sp.entry_point
    def get(self, params):
      sp.set_type(params, sp.TPair(sp.TString, sp.TContract(sp.TPair(sp.TString, sp.TPair(sp.TTimestamp, sp.TNat)))))
      compute_OracleMock_19 = sp.local("compute_OracleMock_19", sp.fst(params))
      compute_OracleMock_20 = sp.local("compute_OracleMock_20", sp.snd(params))
      sp.transfer((compute_OracleMock_19.value, (sp.timestamp(0), self.data.price)), sp.tez(0), compute_OracleMock_20.value)

    @sp.entry_point
    def setPrice(self, params):
      sp.set_type(params, sp.TNat)
      self.data.price = params

    Governor governance

    Pending governance

    Common user attempts to set pending governance

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    tz1ZNmVENjqq916Tq18fZcvdGffReTAu1cTk

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set pending governance

    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    tz1ZNmVENjqq916Tq18fZcvdGffReTAu1cTk

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    tz1ZNmVENjqq916Tq18fZcvdGffReTAu1cTk
    ()

    Accept governance

    Not pending admin attempts to accept governance

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_PENDING_ADMIN'
    ()

    Pending admin attempts to accept governance

    Transaction

    Transaction [OK] by [tz1ZNmVENjqq916Tq18fZcvdGffReTAu1cTk] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator PendingAdministrator
    tz1ZNmVENjqq916Tq18fZcvdGffReTAu1cTk
    ()
    Transaction

    Transaction [OK] by [tz1ZNmVENjqq916Tq18fZcvdGffReTAu1cTk] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator PendingAdministrator
    tz1ZNmVENjqq916Tq18fZcvdGffReTAu1cTk
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    BlockNumber CToken
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setAccrualIntPeriodRelevance (4)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    BlockNumber Comptroller
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setLiquidityPeriodRelevance (4)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT10
    True
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    BlockNumber Comptroller
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setPricePeriodRelevance (4)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT10
    True
    ()

    CXTZ

    Set cToken governance

    Common user attempts to set contract governance

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    ContractAddress Governance
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4ptz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set contract governance

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    ContractAddress Governance
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4ptz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setPendingGovernance (sp.address('tz1WxrQu...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    ()

    Accept cToken governance

    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    ()

    Common user attempts to accept contract governance

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to accept contract governance

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%acceptGovernance (sp.unit)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()

    Set comptroller

    Common user attempts to set comptroller

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Comptroller
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set comptroller

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Comptroller
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setComptroller (sp.address('KT1Tezoo...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()

    Set interest rate model

    Common user attempts to set interest rate model

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken InterestRateModel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set interest rate model

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken InterestRateModel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setInterestRateModel (sp.address('KT1Tezoo...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    9
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setInterestRateModel (sp.address('KT1Tezoo...))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    9
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setInterestRateModelInternal (sp.address('KT1Tezoo...) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setInterestRateModel (sp.address('KT1Tezoo...))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()

    Set reserve factor

    Common user attempts to set reserve factor

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken NewReserveFactor
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set reserve factor

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken NewReserveFactor
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setReserveFactor (2)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    10
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setReserveFactor (2))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    8
    10
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setReserveFactor (2)))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    BaseRatePerBlock MultiplierPerBlock Scale
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setReserveFactor (2))))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    10
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setReserveFactorInternal (2) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%setReserveFactor (2))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()

    Add reserves to reduce

    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000005tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    Transfer 0.000005tz to sp.contract(sp.TRecord(addAmount = sp.TNat, originalSender = sp.TAddress).layout(("addAmount", "originalSender")), KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    AddAmount OriginalSender
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    11
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit)

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    8
    11
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    BaseRatePerBlock MultiplierPerBlock Scale
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit)))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    11
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%addReservesInternal (sp.record(addAmount ...)

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    AddAmount OriginalSender
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000005tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()

    Reduce reserves

    Common user attempts to reduce reserves

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Amount CToken
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to reduce reserves

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Amount CToken
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%reduceReserves (1)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000005tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()
    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    12
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%reduceReserves (1))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000005tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    8
    12
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%reduceReserves (1)))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p).open_some()

    Storage:

    BaseRatePerBlock MultiplierPerBlock Scale
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%reduceReserves (1))))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000005tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    12
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%reduceReservesInternal (1) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%reduceReserves (1))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000005tz

    Operations:

    Transfer 0.000001tz to sp.contract(sp.TUnit, KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller ExpScale HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1%receive (sp.unit) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%reduceReservesInternal (1) (Follow-up-transfer: KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p%reduceReserves (1)))

    Transaction [OK] by [KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000001tz

    Operations:

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()

    CFA12

    Set cToken governance

    Common user attempts to set contract governance

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    ContractAddress Governance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set contract governance

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    ContractAddress Governance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setPendingGovernance (sp.address('tz1WxrQu...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    ()

    Accept cToken governance

    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    ()

    Common user attempts to accept contract governance

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to accept contract governance

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%acceptGovernance (sp.unit)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()

    Set comptroller

    Common user attempts to set comptroller

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Comptroller
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set comptroller

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Comptroller
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setComptroller (sp.address('KT1Tezoo...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()

    Set interest rate model

    Common user attempts to set interest rate model

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken InterestRateModel
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set interest rate model

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken InterestRateModel
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setInterestRateModel (sp.address('KT1Tezoo...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    9
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setInterestRateModel (sp.address('KT1Tezoo...))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    9
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setInterestRateModelInternal (sp.address('KT1Tezoo...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setInterestRateModel (sp.address('KT1Tezoo...))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()

    Set reserve factor

    Common user attempts to set reserve factor

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken NewReserveFactor
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set reserve factor

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken NewReserveFactor
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setReserveFactor (2)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    10
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setReserveFactor (2))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    8
    10
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setReserveFactor (2)))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    BaseRatePerBlock MultiplierPerBlock Scale
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setReserveFactor (2))))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    10
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setReserveFactorInternal (2) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setReserveFactor (2))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()

    Add reserves to reduce

    Transaction

    Transaction [OK] by [] at time [timestamp(0)] to KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    Address Value
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    Balances
    Key Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ()
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    Spender Value
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    Balances
    Key Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Transfer 0.000000tz to sp.contract(sp.TRecord(addAmount = sp.TNat, originalSender = sp.TAddress).layout(("addAmount", "originalSender")), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    AddAmount OriginalSender
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    11
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    8
    11
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    BaseRatePerBlock MultiplierPerBlock Scale
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit)))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    11
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%addReservesInternal (sp.record(addAmount ...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    AddAmount OriginalSender
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()
    From To Value
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC%transfer (sp.record(from_ = sp...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%addReservesInternal (sp.record(addAmount ...))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    From To Value
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    Balances
    Key Approvals Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Key Value
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    ()

    Reduce reserves

    Common user attempts to reduce reserves

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Amount CToken
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to reduce reserves

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Amount CToken
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReserves (500)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    12
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReserves (500))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TPair(sp.TAddress, sp.TContract(sp.TNat)), KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    8
    12
    13
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC%getBalance ((sp.address('KT1Tezo...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReserves (500)))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    Balances
    Key Approvals Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Key Value
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setCash (500) (Follow-up-transfer: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC%getBalance ((sp.address('KT1Tezo...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReserves (500))))

    Transaction [OK] by [KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    8
    12
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReserves (500)))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    BaseRatePerBlock MultiplierPerBlock Scale
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%getBorrowRate (sp.record(borrows = ...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%accrueInterest (sp.unit) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReserves (500))))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    12
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReservesInternal (500) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReserves (500))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()
    From To Value
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa1_2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TotalBorrows TotalReserves TotalSupply
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key AccountBorrows Approvals Balance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo3zzSmartPyzzSTATiCzzzseJjWCKT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC%transfer (sp.record(from_ = sp...) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReservesInternal (500) (Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%reduceReserves (500)))

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    From To Value
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Operations:

    Storage:

    Balances
    Key Approvals Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Key Value
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    ()

    Comptroller

    Set comptroller governance

    Common user attempts to set contract governance

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    ContractAddress Governance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFtz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set contract governance

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    ContractAddress Governance
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFtz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setPendingGovernance (sp.address('tz1WxrQu...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT10
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    True
    ()

    Accept comptroller governance

    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT10
    True
    ()
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT10
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    True
    ()

    Common user attempts to accept contract governance

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to accept contract governance

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TUnit, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%acceptGovernance (sp.unit)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT10
    True
    ()

    Set price oracle

    Common user attempts to set price oracle

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller PriceOracle
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo6zzSmartPyzzSTATiCzzztY1196

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set price oracle

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller PriceOracle
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFKT1Tezooo6zzSmartPyzzSTATiCzzztY1196

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setPriceOracle (sp.address('KT1Tezoo...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    True
    ()

    Set close factor

    Common user attempts to set close factor

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CloseFactor Comptroller
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set close factor

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CloseFactor Comptroller
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setCloseFactor (2)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    True
    ()

    Set liquidation incentive

    Common user attempts to set liquidation incentive

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller LiquidationIncentive
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set liquidation incentive

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller LiquidationIncentive
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setLiquidationIncentive (2)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    True
    ()

    Support market

    Common user attempts to support market

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller Market
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF
    CToken Name
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p'm1'

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to support market

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller Market
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF
    CToken Name
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p'm1'

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(cToken = sp.TAddress, name = sp.TString).layout(("cToken", "name")), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    CToken Name
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p'm1'

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%supportMarket (sp.record(cToken = s...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    CToken Name
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p'm1'

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    'm1'KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key Value
    True
    Mantissa
    TrueTrue'm1'
    Mantissa
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    True
    ()

    Set market borrow cap

    Common user attempts to set market borrow cap

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    BorrowCap Comptroller
    CToken NewBorrowCap
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set market borrow cap

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    BorrowCap Comptroller
    CToken NewBorrowCap
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(cToken = sp.TAddress, newBorrowCap = sp.TNat).layout(("cToken", "newBorrowCap")), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    CToken NewBorrowCap
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setMarketBorrowCap (sp.record(cToken = s...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    CToken NewBorrowCap
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    'm1'KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key Value
    True
    Mantissa
    TrueTrue'm1'
    Mantissa
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    True
    ()

    Set collateral factor

    Common user attempts to set collateral factor

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CollateralFactor Comptroller
    CToken NewCollateralFactor
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set collateral factor

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CollateralFactor Comptroller
    CToken NewCollateralFactor
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(cToken = sp.TAddress, newCollateralFactor = sp.TNat).layout(("cToken", "newCollateralFactor")), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    CToken NewCollateralFactor
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setCollateralFactor (sp.record(cToken = s...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    CToken NewCollateralFactor
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    'm1'KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key Value
    True
    Mantissa
    TrueTrue'm1'
    Mantissa
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    True
    ()

    Set mint paused

    Common user attempts to set mint paused

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller TokenState
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF
    CToken State
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pFalse

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set mint paused

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller TokenState
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF
    CToken State
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pFalse

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(cToken = sp.TAddress, state = sp.TBool).layout(("cToken", "state")), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    CToken State
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pFalse

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setMintPaused (sp.record(cToken = s...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    CToken State
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pFalse

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    'm1'KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key Value
    True
    Mantissa
    TrueFalse'm1'
    Mantissa
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    True
    ()

    Set borrow paused

    Common user attempts to set borrow paused

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller TokenState
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF
    CToken State
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pFalse

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set borrow paused

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller TokenState
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF
    CToken State
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pFalse

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(cToken = sp.TAddress, state = sp.TBool).layout(("cToken", "state")), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    CToken State
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pFalse

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setBorrowPaused (sp.record(cToken = s...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    CToken State
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pFalse

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    'm1'KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key Value
    False
    Mantissa
    TrueFalse'm1'
    Mantissa
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    True
    ()

    Set transfer paused

    Common user attempts to set transfer paused

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller State
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to set transfer paused

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Comptroller State
    KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TBool, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    False

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%setTransferPaused (False)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    False

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    'm1'KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key Value
    False
    Mantissa
    TrueFalse'm1'
    Mantissa
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    False
    ()

    Disable market

    Common user attempts to disable market

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Comptroller
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Error:

    Wrong condition:
    Message: 'GOV_NOT_ADMIN'
    ()

    Admin attempts to disable market

    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Comptroller
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4pKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000001tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TAddress, KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Storage:

    Administrator PendingAdministrator
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%disableMarket (sp.address('KT1Tezoo...)

    Transaction [OK] by [KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p

    Balance: 0.000000tz

    Operations:

    Storage:

    Account_assets Account_liquidity ActiveOperations Administrator Calculation CloseFactorMantissa ExpScale HalfExpScale LiquidationIncentiveMantissa LiquidityPeriodRelevance MarketNameToAddress Markets OracleAddress PendingAdministrator PricePeriodRelevance TransferPaused
    Key Value
    Key Liquidity UpdateLevel Valid
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1
    Account BorrowAmount CTokenModify RedeemTokens SumBorrowPlusEffects SumCollateral
    Key Value
    'm1'KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key AccountMembership BorrowCap BorrowPaused CollateralFactor IsListed MintPaused Name Price UpdateLevel
    KT1Tezooo5zzSmartPyzzSTATiCzzzz48Z4p
    Key Value
    False
    Mantissa
    FalseFalse'm1'
    Mantissa
    KT1Tezooo6zzSmartPyzzSTATiCzzztY1196
    False
    ()